package com.owen.spring.cloud.sentinel.controller;

import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import java.util.concurrent.atomic.AtomicInteger;

@RestController
@RequestMapping("/test")
public class TestController {

    private AtomicInteger integer=new AtomicInteger();

    @RequestMapping("/add")
    public Integer add(){
        int i = integer.incrementAndGet();
        return i;
    }

    @RequestMapping("/reset")
    public Integer reset(){
        integer.set(0);
        return integer.get();
    }

    @RequestMapping("/get")
    public Integer get(){
        return integer.get();
    }
}
